101 Microsoft Visual Basic .NET Applications
Create a Screensaver with GDI+
This sample shows how to create a screen saver using Visual Basic
.NET.
Featured Highlights:
This how-to demonstrates many of the important features of creating screen
savers that can be automated by Windows. Concepts demonstrated are:
-
Creating
a screen saver to fill the screen with a single
form and to draw images to the form.
-
Setting up an Options file to store user-defined
options that guide how the screen saver runs.
-
Reacting to mouse and keyboard events to close the screen saver.
The screen-saver preview functionality is not demonstrated, since it involves
several advanced threading issues.
Requirements:
- Microsoft Visual Studio .NET Professional (or greater).
- Windows 2000 or Windows XP.
Running the Sample:
To run the sample:
- Press F5.
-
Click the Install button on the main form to copy
the screen saver to the Windows system folder.
-
Go into your display settings, and set the screen
saver as 101 VB.NET Sample Applications Screen Saver.
-
Test the screensaver.
- Explore the GDI+ Screen Saver project for an example of
how to create your own screen saver.
Notes:
When you compile your screen saver, there are several things to keep in
mind. First, be sure to set the following Form Properties:
-
FormBorderStyle = None
-
WindowState = Maximized
-
MaximizeBox = False
-
MinimizeBox = False
-
ShowInTaskbar = False
Before you can use a newly compiled screen saver, you
must change its extension from .EXE to .SCR, and copy it to the Windows system
directory (by default, in Windows XP, this is
"C:\Windows\System32").